package me.CSmethod.demo.lianxi;

public class Text122 {
    public static void main(String[] args) {
        int[][] yearArr={{22,66,44},
                {77,33,88},
                {25,45,65},
                {11,66,99}};
        int ans=0;
        for (int i = 0; i < yearArr.length; i++) {
            int[] quarter=yearArr[i];
            int sum=getsum(quarter);
            System.out.println("第"+(i+1)+"季度的和为"+sum);
            ans+=sum;
        }
        System.out.println("全年的和为"+ans);
    }
    public static int getsum(int[] a){
        int sum=0;
        for (int i = 0; i < a.length; i++) {
            sum+=a[i];
        }
        return sum;
    }
}
